🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / model / src / commonMain / kotlin / org / meshtastic / core / model / PowerChannelLabels.kt
Displaying Raw • Download
core/model/src/commonMain/kotlin/org/meshtastic/core/model/PowerChannelLabels.kt 01cd54907d62cd90913d3d071b6bc240cae365ef (01cd5490) Text, 1.35 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model
T8b949e/**
* Merges a user-editable power-channel [label] into [existing] at the 0-based [channelIndex].
*
* Earlier channels keep their slot via blank padding, the label is trimmed, and trailing blanks are dropped so clearing
* a label shrinks the list. Shared by the DB write path and test fakes so the rule can't drift between them.
*/
Tff7b72fun Td2a8ffmergePowerChannelLabelTb4b4b4(Te6edf3existingTb4b4b4: Te6edf3ListTff7b72<Tffa657StringTff7b72>Tb4b4b4, Te6edf3channelIndexTb4b4b4: Tffa657IntTb4b4b4, Te6edf3labelTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3ListTff7b72<Tffa657StringTff7b72> Tb4b4b4{
Tff7b72val Te6edf3labels Tff7b72= Te6edf3existingTb4b4b4.Te6edf3toMutableListTb4b4b4(Tb4b4b4)
Tff7b72while Tb4b4b4(Te6edf3labelsTb4b4b4.Te6edf3size Tff7b72<Tff7b72= Te6edf3channelIndexTb4b4b4) Te6edf3labelsTb4b4b4.Te6edf3addTb4b4b4(Ta5d6ff"Ta5d6ff"Tb4b4b4)
Te6edf3labelsTff7b72[Te6edf3channelIndexTff7b72] Tff7b72= Te6edf3labelTb4b4b4.Te6edf3trimTb4b4b4(Tb4b4b4)
Tff7b72return Te6edf3labelsTb4b4b4.Te6edf3dropLastWhile Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3isBlankTb4b4b4(Tb4b4b4) Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.07s